package com.remoter.basic.transport;

import java.net.InetSocketAddress;

import com.remoter.basic.bean.support.ProviderModule;
import com.remoter.basic.bean.support.RemoterRequest;
import com.remoter.basic.util.ServiceLoader.SPI;
import com.remoter.basic.util.ServiceLoader.Scope;

/**
 * @author			koko
 * @date 			2017-08-10 11:38:33
 * @description 	类功能说明
 */
@SPI(scope=Scope.PROTOTYPE)
public interface IServer {
	
	/**
	 * 如果local为null,使用本地默认的配置
	 * @param local
	 * @throws Exception
	 */
	public void bind(InetSocketAddress local)throws Exception;
	
	public void unBind()throws Exception;
	
	public boolean isAvailable();
	
	public InetSocketAddress getLocalAddress();
	
	public void attachProvider(ProviderModule providerModule);
	public void detachProvider(ProviderModule providerModule);
	public ProviderModule getProviderModule(RemoterRequest remoterRequest);
	
}